<extend name="Public/base" />

<block name="body">
<div class="main-title">
<h2>{:isset($master['id'])?'编辑':'新增'}大师</h2>
</div>
<script type="text/javascript"
	src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<form action="{:U()}" method="post" class="form-horizontal">
<div class="form-item"><label class="item-label">大师UID<span
	class="check-tips">（大师UID）</span></label>
<div class="controls"><input type="text" class="text input-large"
	name="uid" value="{$master.uid|default=''}"></div>
</div>

<div class="form-item"><label class="item-label">归属游戏<span
	class="check-tips">（是什么游戏的大师）</span></label>
<div class="controls"><select name="game_id">
	<volist name="games" id="game">

	<option value="{$game.id}"<eq name="master['game_id']"
		value="$game.id"> selected</eq>>{$game.title_show}</option>
	</volist>
</select></div>
</div>
<div class="form-item"><label class="item-label">大师标签<span
	class="check-tips">（大师标签）</span></label>
<div class="controls"><input type="text" class="text input-large"
	name="tags" value="{$master.tags|default=''}"></div>
</div>

<div class="form-item"><label class="item-label">游戏ID<span
	class="check-tips">（游戏ID）</span></label>
<div class="controls"><input type="text" class="text input-large"
	name="game_nick_name" value="{$master.game_nick_name|default=''}">
</div>
</div>

<div class="form-item"><label class="item-label">荣誉称号<span
	class="check-tips">（荣誉称号）</span></label>
<div class="controls"><input type="text" class="text input-large"
	name="honor_title" value="{$master.honor_title|default=''}"></div>
</div>

<div class="form-item"><label class="item-label">游戏位置<span
	class="check-tips">（游戏位置）</span></label>
<div class="controls"><input type="text" class="text input-large"
	name="game_place" value="{$master.game_place|default=''}"></div>
</div>


<div class="form-item"><label class="item-label">战队<span
	class="check-tips">（战队）</span></label>
<div class="controls"><input type="text" class="text input-large"
	name="team" value="{$master.team|default=''}"></div>
</div>

<div class="form-item"><label class="item-label">微博<span
	class="check-tips">（微博）</span></label>
<div class="controls"><input type="text" class="text input-large"
	name="weibo" value="{$master.weibo|default=''}"></div>
</div>



<div class="form-item"><label class="item-label">大师图腾</label> <input
	type="file" id="upload_picture"> <input type="hidden"
	name="cover" id="cover" value="{$master['cover']|default=''}" />
<div class="upload-img-box"><notempty name="master['cover']">
<div class="upload-pre-item"><img
	src="{$master.cover|get_cover='url'}" /></div>
</notempty></div>
</div>
<script type="text/javascript">
					//上传图片
				    /* 初始化上传插件 */
					$("#upload_picture").uploadify({
				        "height"          : 30,
				        "swf"             : "__STATIC__/uploadify/uploadify.swf",
				        "fileObjName"     : "download",
				        "buttonText"      : "上传图片",
				        "uploader"        : "{:U('File/uploadMasterPic',array('session_id'=>session_id()))}",
				        "width"           : 120,
				        'removeTimeout'	  : 1,
				        'fileTypeExts'	  : '*.jpg; *.png; *.gif;',
				        "onUploadSuccess" : uploadMasterPic,
				        'onFallback' : function() {
				            alert('未检测到兼容版本的Flash.');
				        }
				    });
					function uploadMasterPic(file, data){
				    	var data = $.parseJSON(data);
				    	var src = '';
				        if(data.status){
				        	$("#cover").val(data.id);
				        	src = data.url;
				        	$("#cover").parent().find('.upload-img-box').html(
				        		'<div class="upload-pre-item"><img src="' + src + '"/></div>'
				        	);
				        } else {
				      
				        	updateAlert(data.info);
				        	setTimeout(function(){
				                $('#top-alert').find('button').click();
				                $(that).removeClass('disabled').prop('disabled',false);
				            },1500);
				        }
				    }
					</script>


<div class="form-item"><label class="item-label">大师介绍<span
	class="check-tips">（大师名称昵称）</span></label>
<div class="controls"><label class="textarea input-large">
<textarea name="description">{$master.description|default=''}</textarea>
</label></div>
</div>
<div class="form-item"><input type="hidden" name="id"
	value="{$master.id|default=''}">
<button class="btn submit-btn ajax-post" id="submit" type="submit"
	target-form="form-horizontal">确 定</button>
<button class="btn btn-return"
	onclick="javascript:history.back(-1);return false;">返 回</button>
</div>
</form>
</block>

<block name="script">
<script type="text/javascript">
        //导航高亮
        highlight_subnav('{:U('Commentator/index')}');
    </script>
</block>
